<php>
    $name = ACTION_NAME;

</php>
<div class="mui-bar mui-bar-tab">
    <a jump_url="{:U('Storehouse/join')}" _class="a" <if condition="$name eq 'join'">class="mui-tab-item mui-active"<else/>class="mui-tab-item"</if> ">
        <span class="mui-icon mui-icon-home"></span>
        <span  class="mui-tab-label">分享的仓</span>
    </a>

    <a _class="a" class="mui-tab-item" href="http://www.baidu.com">
        <span  class="mui-icon mui-icon-email"></span>
        <span  class="mui-tab-label">统计</span>
    </a>
    <a jump_url="{:U('My/indexSet')}" _class="a"   <if condition="$name eq 'indexSet'">class="mui-tab-item mui-active"<else/>class="mui-tab-item"</if> href="http://www.baidu.com" >
        <span    class="mui-icon mui-icon-contact"></span>
        <span   class="mui-tab-label">我的</span>
    </a>
</div>
<script>
    xunhuan = setInterval(function(){
        host = window.location.host;
        $('[_class="a"]').each(function()
        {
            //如果是选中状态
            if($(this).attr('class') == 'mui-tab-item mui-active')
            {
                //比对跳转url 和当前url 是否相同
                //不相同跳转
                //跳转url
                var url = 'http://'+host+$(this).attr('jump_url')
                //alert(url)
                //当前url
                var durl = window.location.href;
                if(url != durl)
                {

                    clearInterval(xunhuan);
                    location.href = url

                }
            }

        })

    },100);
</script>